﻿<%@ Page Title="用户列表" Language="C#" MasterPageFile="~/Shared/MainPage.Master" AutoEventWireup="true" CodeBehind="UserList.aspx.cs" Inherits="Runda.CMS.Portal.SysManage.UserList" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
    <script src="../Content/global.js" type="text/javascript"></script>     
    <link href="../Content/global.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Menu/Menu.css" rel="stylesheet" type="text/css" /> 
   <link href="../Content/Grid/Grid.css" rel="stylesheet" type="text/css" /> 
    <script src="../Content/Grid/map_grid.js" type="text/javascript" ></script>
    <link href="../Content/Pager.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function OpenEditUser(UserID) {
            openMyFullWin('UserAdd.aspx?UserID=' + UserID, 'edituser');
        }
        function getids() {           
            var arrTr = grid.getSelected();
            if (arrTr.length > 0) {
                if (!confirm('确认停用该账户吗?')) {
                    return;
                }    
                var ids = "";
                for (var i = 0; i < arrTr.length; i++) {
                    if (ids != "") {
                        ids += ";";
                    }
                    ids += arrTr[i].oid;
                }
                document.getElementById('<%=userids.ClientID %>').value = ids;
                document.getElementById('<%=lnkbtnDelete.ClientID %>').click();
            }
        }
                       
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" runat="server">
<div class="Container">
        <table id="appFind" class="find" cellspacing="0" cellpadding="0" border="0" width="100%"> 
            <tbody>
                <tr height="23">
                    <td class="wizHead" colspan="7">
                        <table style="table-layout: fixed; font-size: 9pt" cellspacing="0" cellpadding="0" width="100%" height="100%">
                            <colgroup>
                                <col>
                                <col width="60">
                                <col width="60"> 
                                <tr><td style="color:#ffffff"><b>快速查询</b></td><td class="icMenu mnuRight" noWrap></td></tr>
                        </table>
                    </td>
                </tr>
                <tr id="__appFind_trQuery" height="40">
                    <td class="wizBox1" colspan="7">
                    <table id="__appFind_tbQuery1" style="TABLE-LAYOUT: fixed; FONT-SIZE: 9pt" height="100%" cellSpacing="0" cellPadding="0" width="100%">
                    <tr>
                        <td style="width:15%">登录账号：</td>
                        <td style="width:25%">
                            <asp:TextBox ID="txtAccount" runat="server" Width="180px" CssClass="input"></asp:TextBox></td>
                        <td align="right" style="width:15%"> 用户姓名：</td>
                        <td style="width:25%"><asp:TextBox ID="txtUserName" runat="server" Width="180px" CssClass="input"></asp:TextBox></td>
                        <td style="width:15%"><asp:CheckBox ID="includeDel" runat="server" Text ="已停用"/></td>
                        <td style="width:10%"><asp:Button ID="btnSearchBasic" runat="server" Text="查找" CssClass="button" onclick="btnSearch_Click"/></td>
                        </tr></table>
                    
                    </td>
                </tr>
            </tbody>
    </table>            
</div>
 <div class="Container">
         
         <table class="mnubar" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        <b>用户列表</b>
                    </td>
                    <td style="padding-left: 5px">
                        <img src="../Content/Grid/separator.gif">
                    </td>
                    <td class="icMenu" nowrap>
                        <span class="menu" tabindex="0" menu="appGridMenu_mainmnu">操作<img src="../Content/Grid/mnuDown.gif">
                            <table id="appGridMenu_mainmnu" class="mnuList" cellspacing="0" cellpadding="3">
                                <colgroup>
                                    <col class="mnuLeft">
                                    <col class="mnuItm">
                                    <col align="right" width="20">
                                    <tbody>
                                        <tr tabindex="0"  action="getids()">
                                            <td>
                                            </td>
                                            <td colspan="2" nowrap>
                                                <asp:LinkButton ID="lnkbtnDelete" runat="server" onclick="lnkbtnDelete_Click">停用</asp:LinkButton>
                                                <input type="hidden" runat="server" id="userids" />
                                            </td>
                                        </tr>
                                        
                                    </tbody>
                            </table>
                        </span>
                    </td>
                    <td class="icMenu mnuRight" nowrap>
                        <span class="menu"  onclick="openMyFullWin('UserAdd.aspx','adduser');">
                            <img class="mnuBtn" src="../Content/Grid/New_16_blue.gif"><span class="mnuBtn">新增用户</span></span>
                    </td>
                </tr>
            </tbody>
        </table>       
         
        <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
        </div>
             <asp:Repeater ID="RepeaterUsers" runat="server" 
                 onitemcommand="RepeaterUsers_ItemCommand" 
             onitemdatabound="RepeaterUsers_ItemDataBound">
                 <HeaderTemplate>
                    <table id="grid" class="grid" cellspacing="0" cellpadding="0">
            <tbody>
                <tr class="header">
                    <td align="middle"> 
                    <div><div style="display:inline;float:left;height:auto; overflow:hidden;width:96%;text-align:center;">用户帐号</div>
                        <div style="display:inline;float:right;height:auto; overflow:hidden;"><img src="../Content/Grid/bar_line.gif" border="0"></div>
                        </div>
                    </td>
                      <td align="middle"> 
                    <div><div style="display:inline;float:left;height:auto; overflow:hidden;width:96%;text-align:center;">用户姓名</div>
                        <div style="display:inline;float:right;height:auto; overflow:hidden;"><img src="../Content/Grid/bar_line.gif" border="0"></div>
                        </div>
                    </td>
                    <td align="middle"> 
                    <div><div style="display:inline;float:left;height:auto; overflow:hidden;width:96%;text-align:center;">创建时间</div>
                        <div style="display:inline;float:right;height:auto; overflow:hidden;"><img src="../Content/Grid/bar_line.gif" border="0"></div>
                        </div>
                    </td> 
                    <td align="middle"> 
                    <div><div style="display:inline;float:left;height:auto; overflow:hidden;width:96%;text-align:center;">状态</div>
                        <div style="display:inline;float:right;height:auto; overflow:hidden;"><img src="../Content/Grid/bar_line.gif" border="0"></div>
                        </div>
                    </td> 
                    <td align="middle"> 
                    <div><div style="display:inline;float:left;height:auto; overflow:hidden;width:96%;text-align:center;">最后登陆时间</div>
                        <div style="display:inline;float:right;height:auto; overflow:hidden;"><img src="../Content/Grid/bar_line.gif" border="0"></div>
                        </div>
                    </td> 
                    <td width="14">
                        <asp:ImageButton ID="imgbtnRefersh" CommandName="refersh" runat="server" ImageUrl="../Content/Grid/grid_Refresh.gif" AlternateText="刷新列表"/> 
                    </td>
                </tr>
                 </HeaderTemplate>
                 <ItemTemplate>
                  <tr class="data" ondblclick="OpenEditUser('<%#Eval("UserID") %>')" onclick="handleClick()" oid='<%# Eval("UserID")%>'>
                    <td><%#Eval("Account")%>
                    <asp:Label runat="server" ID="userID" Text='<%# Eval("UserID")%>'  Visible="false"></asp:Label></td> 
                    <td><%#Eval("UserName")%></td> 
                    <td><%#Eval("CreatedOn") %></td>
                    <td>
                    <asp:Label runat="server" ID="Status" Text='<%# Eval("Deleted")%>' Visible="false"></asp:Label>
                        <asp:Label runat="server" ID="StatusName"></asp:Label>
                        <asp:LinkButton ID="lbReStart" runat="server" CommandName="ReStart">重新启用</asp:LinkButton>
                        <asp:LinkButton ID="lbReSetPwd" runat="server" CommandName="ReSetPwd">密码重设</asp:LinkButton>
                    </td>
                    <td>
                    <asp:Label runat="server" ID="LastLogintime"  Visible="true"></asp:Label>
                    </td>  
                    <td></td>
                </tr>
                 </ItemTemplate>
                 <FooterTemplate>
                    </tbody>
                </table>  
                 </FooterTemplate>
             </asp:Repeater>    
               <webdiyer:AspNetPager ID="AspNetPager1" runat="server" CssClass="paginator" PageSize="15"
                            CurrentPageButtonClass="cpb" 
                            CustomInfoHTML="第%CurrentPageIndex%页，共%PageCount%页，每页%PageSize%条" 
                            FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" 
                            ShowCustomInfoSection="Left" Width="100%" LayoutType="Table"  
                            SubmitButtonClass="but" SubmitButtonText="转到" OnPageChanged="AspNetPager1_PageChanged">
                        </webdiyer:AspNetPager>    
         </div>
</asp:Content>
